package com.kfm.spring.aa;

public class Resolve {
    public static void main(String[] args) {
        System.out.println(resolve(10));
    }

    public static String resolve(int num){
        StringBuffer sb = new StringBuffer(num+"=");
        int i = 2;
        while (i<=num){
            //i为num的因数
            if (num%i==0){
                if(num==i){
                    sb.append(num+"*");
                    break;
                }else {
                    sb.append(i+"*");
                    num = num/2;
                    i=2;
                }
            }else {
                i++;
            }
        }
        return sb.toString().substring(0,sb.toString().length()-1);
    }
}
